# n = input()
# for x in range(int(n)):
#     ID = input()
#     char = input()
#     ch = char.split()
#     I = ID.split()
#     p = str(int(I[0])+int(ch[1])+int(ch[2]))
#     print("学号:"+I[0],"Python成绩："+ch[0],"高数成绩："+ch[1],"外语成绩："+ch[2],"总成绩："+p)


n = input()
for x in range(int(n)):
    ID = input().split()
    char = input().split()
    p = str(int(ID[0])+int(char[1])+int(char[2]))
    print("学号:"+ID[0],"Python成绩："+char[0],"高数成绩："+char[1],"外语成绩："+char[2],"总成绩："+p)
